package top.i51213.fastaction.action;

import androidx.annotation.NonNull;

public enum DataType {

    IMAGE("图片",IntentType.Share, IntentType.Save, IntentType.ZipCompress, IntentType.Print,IntentType.ImageCompress, IntentType.Pdf),
    ZipFile("Zip",IntentType.Share, IntentType.Save, IntentType.ZipCompress),
    PdfFile("Pdf",IntentType.Share, IntentType.Save, IntentType.ZipCompress, IntentType.Print,IntentType.ImageCompress, IntentType.Pdf),
    Any("任意类型",IntentType.Share, IntentType.Save, IntentType.ZipCompress);

    private final String title;
    private final IntentType[] values;

    DataType(String title,IntentType... values) {
        this.title=title;
        this.values = values;
    }

    public boolean hasIntent(IntentType action) {
        for (IntentType a : values) {
            if (a == action) return true;
        }
        return false;
    }

    @NonNull
    @Override
    public String toString() {
        return  this.title;
    }
}
